// 数据库
import { defineStore } from "pinia";
import { getCategoryapi } from "@/apis/layout";
import { ref } from "vue";

export const useCatagoryStore = defineStore("category", () => {
  // 导航列表的数据管理
  const categorylist = ref([]);
  const getCategory = async () => {
    const res = await getCategoryapi();
    categorylist.value = res.result;
  };
  return {
    categorylist,
    getCategory,
  };
});
